package comment;

import java.util.Random;

/**
 *create by tbj
 */
public class Comment {
	
	public static int[] getSortIntArr(){
		int arr[]=new int[]{6,54,7,4,9,2,11};
		System.out.print("原：  ");
		for (int i=0;i<arr.length;i++) {
			if(i!=arr.length-1){
				System.out.print(arr[i]+" ");
			}else{
				System.out.println(arr[i]);
			}
		}
		return arr;
	}
	public static int[] getRandIntArr(int n){
		int arr[]=new int[n];
		System.out.print("原：  ");
		Random random=new Random();
		for (int i=0;i<arr.length;i++) {
			
			arr[i]=random.nextInt(n+1);
			/*if(i!=arr.length-1){
				System.out.print(arr[i]+" ");
			}else{
				System.out.println(arr[i]);
			}*/
		}
		return arr;
	}
	public static int[] getOrderedArray(int num){
		int[] a=new int[num];
		for(int i=0;i<num;i++){
			a[i]=i+1;
			System.out.print(a[i]+" ");
		}
		System.out.println();
		return a;
	}
	public static void swapIntArr(int[] arr,int i,int j){
		int temp=arr[i];
		arr[i]=arr[j];
		arr[j]=temp;
	}
	
	
}
